package com.app.action.user;

import javax.annotation.Resource;
import javax.inject.Inject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.app.action.BaseAction;
import com.app.beans.User;
import com.app.service.userService.UserService;

@Controller
public class UserAction extends BaseAction {
	private UserService userService;
	private User user = new User();
	
	@Resource
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	@Inject
	public void setUser(User user) {
		this.user = user;
	}
	
	public boolean addUser() {
		return userService.addUser(user);
	}
	
	public User findUser() {
		User u = userService.findUser(1);
		System.out.println(u.toString());
		return u;
	}
}
